import fixBottom from '@/components/fixBottom'
export default {
    data() {
        return {
            menuHeght: "",
            user: "",
            openid: "",
            img: "http://img0.imgtn.bdimg.com/it/u=3880133255,4090820197&fm=214&gp=0.jpg"
        }
    },
    components: {
        fixBottom,
    },
    methods: {
        goRecharge() {
            this.$router.push({ path: "/recharge" })
        },
        goFeedback() {
            this.$router.push({ path: "/feedback" })
        },
        goRecord() {
            this.$router.push({ path: "/record" })
        },
        goOrder(id) {
            if (id!=null){
                this.$router.push({ path: "/order", query: { id: id } })
            }else{
                this.$router.push({ path: "/order"})
            }
            
        },
        tel(phone) {
            window.location.href = "tel:" + 15179643695;
        },
        getUser() {
            this.axios.get('/member/info', {
                params: {
                    openid: this.openid
                }
            }).then(res => {
                if (res.data.result) {
                    this.user = res.data.datas;
                    console.log(res)
                }
            }, err => {
                console.log(err)
            })
        }
    },
    mounted() {
        console.log(document.body.offsetHeight)
        this.menuHeght = this.$refs.menu.clientHeight;
        console.log(this.menuHeght)
        this.$refs.menu.style.minHeight = `${document.body.offsetHeight - this.menuHeght - 150}px`
    },
    created() {
        sessionStorage.setItem('openId', "o-37usxE6mVetx1xAhroaJ8joVGo")
        this.openid = sessionStorage.getItem("openId")
        this.getUser();
    },
}